package cc.vv.btpartyjob.partymanager.activity

import android.content.Intent
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partymanager.delegate.ManagerBaseBinder
import cc.vv.btpartyjob.partymanager.delegate.WangGeDetailActivityDelegate
import cc.vv.btpartyjob.partymanager.globle.IntentManageKey
import cc.vv.btpartyjob.partymanager.inter.OperationItemClickInterface
import cc.vv.btpartyjob.partymanager.moudel.bean.OperationBean
import cc.vv.btpartyjob.partymanager.server.PartyManagerMainFragmentServer
import cc.vv.mvp.activity.BaseActivityMVP
import cc.vv.mvp.binder.BaseDataBinder

/**
 * 网格详情
 * Created by Chen.qi on 2018/10/25.
 */
class WangGeDetailActivity : BaseActivityMVP<WangGeDetailActivityDelegate>(), OperationItemClickInterface {

    /**
     * 网格Id
     */
    private var gridDetailId: String? = null


    override fun initData() {
        gridDetailId = intent.getStringExtra(IntentManageKey.INTENT_KEY_DETAIL_ID)
        try {
            val title: String = intent.getStringExtra(IntentManageKey.INTENT_KEY_TITLE_NAME)
            viewDelegate?.setTopBarTitle(title)
        } catch (e: Exception) {
        }
        viewDelegate?.setLouDongTeamData(PartyManagerMainFragmentServer.getLouDongTeam(), this)
    }

    override fun bindEvenListener() {
        viewDelegate?.setTitleBackBtnOnClick(object : BaseTopBarView.EventInterface {
            //返回
            override fun leftOnClick() {
                finish()
            }

            override fun leftCloseClick() {}
            override fun rightOnClick() {
            }
        })
    }

    override fun getDelegateClass(): Class<WangGeDetailActivityDelegate> {
        return WangGeDetailActivityDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return ManagerBaseBinder()
    }

    override fun clickItem(operaObj: OperationBean) {
        val intent = Intent(this, LouDongTeamActivity::class.java)
        startActivity(intent)
    }

}